package com.tubang.logistics.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.tubang.logistics.entity.PlatformOrderGoodsEntity;
import com.tubang.logistics.mapper.PlatformOrderGoodsMapper;
import com.tubang.logistics.service.IPlatformOrderGoodsService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 平台运单-货品 服务实现类
 * </p>
 *
 * @author wsl
 * @since 2018-01-11
 */
@Service
public class PlatformOrderGoodsServiceImpl extends ServiceImpl<PlatformOrderGoodsMapper, PlatformOrderGoodsEntity> implements IPlatformOrderGoodsService {

    @Override
    public PlatformOrderGoodsEntity selectOrderByGoodsId(String id) {
        EntityWrapper<PlatformOrderGoodsEntity> entityWrapper = new EntityWrapper<PlatformOrderGoodsEntity>();
        entityWrapper.eq("goods_id",id);
        PlatformOrderGoodsEntity platformOrderGoodsEntity = selectOne(entityWrapper);
        return platformOrderGoodsEntity;
    }

    @Override
    public List<PlatformOrderGoodsEntity> selectOrderByOrderId(String orderId) {
        EntityWrapper<PlatformOrderGoodsEntity> entityWrapper = new EntityWrapper<PlatformOrderGoodsEntity>();
        entityWrapper.eq("platform_order_id",orderId);
        List<PlatformOrderGoodsEntity> platformOrderGoodsEntities = selectList(entityWrapper);
        return platformOrderGoodsEntities;
    }
}
